package com.liveinstars.im.common.enums;

import java.util.HashMap;

/**
 * @author: zhouze
 * @date: 2020/3/5
 */
public enum ChatGroupTypeEnum {

    CHAT_CIRCLE(0, "圈子"),
    CHAT_ROOM(2, "聊天室"),
    PERSON_TO_PERSON(3, "点聊组"),
    ;

    private int value;

    private String text;

    ChatGroupTypeEnum( int value, String text) {
        this.text = text;
        this.value = value;
    }

    private static HashMap<Integer, ChatGroupTypeEnum> enumValueMap = new HashMap<>();

    static {
        for (ChatGroupTypeEnum chatGroupTypeEnum : ChatGroupTypeEnum.values()) {
            enumValueMap.put(chatGroupTypeEnum.getValue(), chatGroupTypeEnum);
        }
    }

    public static ChatGroupTypeEnum valueOf(int value) {
        return enumValueMap.get(value);
    }

    public String getText() {
        return text;
    }

    public int getValue() {
        return value;
    }
}
